package com.wiloon.java8x;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class HashMapTest {

	public HashMapTest() {
		System.out.println("Constructor called");
	}

	static {
		System.out.println("Static block called");
	}

	{
		System.out.println("Instance initializer called");
	}

	public static void main(String... args) {
		new HashMapTest();
		System.out.println("=======================");
		new HashMapTest();
		foo();

	}

	public static void foo() {
		HashMap<String, String> mapFoo = new HashMap<String, String>();
		mapFoo.put("Name", "foo");
		mapFoo.put("id", "000");

		HashMap<String, String> mapBar = new HashMap<String, String>() {
			{
				put("Name", "bar");
				put("id", "111");
			}
		};

		List<String> l = new ArrayList<String>() {
			{
				add("foo");
				add("foo");
			}
		};

		// List<String> ttttt = ["item"];

		// Set<String> set = { "item" };
		// Map<String, Integer> map = { "key": 1 };

		System.out.println(mapBar.size());
		// System.out.println(list.size());
	}
}